<template>
  <ul class="common-list-layout clearfix">
    <li class="common-list-item fl" v-for="(item,index) in itemData" :key="index" @click="toItem(route, item)">
      <div class="common-list-top">
        <div class="txt">
          <h3>{{item.name}}</h3>
          <p>{{item.time}}</p>
        </div>
      </div>
      <div class="common-list-bottom clearfix">
        <span class="num fl">{{item.num}}</span>
        <span class="txt fl">{{item.txt}}</span>
      </div>
    </li>
  </ul>
</template>
<script>
  export default {
    data () {
      return {}
    },
    props: ['itemData', 'route'],
    methods: {
      toItem (route, item) {
        this.$router.push({path: `/${route}`, query: {id: `${item.id}`}})
        sessionStorage.setItem('projectItemData', JSON.stringify(item))
      }
    }
  }
</script>

